#include <iostream>
#include "Exception.h"
#include "SeqList.h"
#include "StaticList.h"
#include "DynamicList.h"
#include "Array.h"
#include "StaticArray.h"
#include "DynamicArray.h"

#include "LinkList.h"

using namespace std;
using namespace StructLib;

#define TestModel(x) \
    if (x)           \
    {
#define END }

enum TestModels
{
    DefaultTest = false,
    HeadNodeErrorTest = true,
};

class Test
{
public:
    Test()
    {
        throw 0;
    }
};


void FunTest()
{
TestModel(DefaultTest)
    LinkList<int> list;

    for (int i = 0; i< 5; i++)
    {
        list.Insert(0, i);
        list.Set(0, i*i);
    }

    for (int i = 0; i< list.Length(); i++)
    {
        std::cout << list.Get(i) << std::endl;
    }

    list.Remove(2);

    list.Clear();

    for (int i = 0; i< list.Length(); i++)
    {
        std::cout << list.Get(i) << std::endl;
    }
END

TestModel(HeadNodeErrorTest)
    LinkList<Test> list;

    std::cout << "HeadNodeError Test" << std::endl;
END
}

int main()
{
    FunTest();

    std::cout << "this main()" << std::endl;
    return 0;
}
